package com.example.webserver.entity;

import com.example.webserver.aono.State;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

@Data
public class Article {
    private int id;

    @NotEmpty
    @Size(min=1,max=10)
    private String title;

    @NotEmpty
    private String content;


    @URL
    private String cover_img;
    @State
    private String state;

    @NotNull
    private int category_id;
    private int create_user;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime create_time;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime update_time;
}
